<%+header%>

<script>  //general function
	function getValue(ID)
	{
		return document.getElementById(ID).value;
	}
	function setDisplay(ID,type)
	{
		if(!type)
		{
			document.getElementById(ID).style.display="none";
		}
		else
		{
			document.getElementById(ID).style.display="inline";
		}
	}
	function setHTML(ID,STR)
	{
		document.getElementById(ID).innerHTML=STR;
	}
	function setValue(ID,val){
		document.getElementById(ID).value=val;	
	}
</script>
<script>
	function getCliAccUrl(mac)
	{
		var device_detail=function (cli_url)
		{
				var detailStr='';
				for(var i=0;i<cli_url.length;i++)
				{
					detailStr+='<tr>'
						+'<td ><%:URL:%></td><td  style="color:red">'+cli_url[i].url+'</td>'
						+'<td width="23%"></td>'
						+'<td ></td><td ></td>'
						+'<td ></td>'
						+'<td ></td>'
					+'</tr>';
				}
				
				setHTML("ID_Table_dev_detail",detailStr);	
				setHTML("ID_TD_CurrentData",cli_url.length);	
		}

     var pollPath='<%=luci.dispatcher.build_url("admin", "behavioranalysis","cli_acc_url")%>';
     pollPath=pollPath+'/'+mac;
	   XHR.poll(1,pollPath,null,function(x,rval){
		    device_detail(rval[0]);
		    clearInterval(XHR._i);
		  }
		  
	  );
	  setDisplay("ID_Table_dev",false);
	  setDisplay("ID_Table_dev_detail",true);
		setDisplay("ID_Table_Detail",true);
  }
</script>
<style>
	.tab{
	  width: 100%;
    padding: 0;
    font-size: 13px;
    border-collapse: collapse;
  }
  .tab td{
  		padding: 10px 10px 9px;
			line-height: 18px;
			text-align: left;
			border-top: 0px solid #ddd;
			vertical-align: middle;
  }
</style>
<table id="ID_Table_Detail" class="tab" style="display:none;">
	<tr>
		<td width="12%"><%:Current data%>:</td>
		<td id="ID_TD_CurrentData" width="5%" style="color:red">0</td>
		<td width="5%"><%:item%></td>
		<td width="50%"><%:Please input source MAC%>: <input class="cbi-input-text" id="ID_INPUT_srcMAC" type="text" ><input class="cbi-button" id="ID_INPUT_srcMAC" type="button" value="<%:search%>" onclick="function(){};"></td>
		<td><input id="ID_INPUT_Backbutton" type="button" class="cbi-button" value="<%:Back%>" onclick="getClientMac();"></td>
	</tr>
</table>

<fieldset class="cbi-section">
	<table width="100%" cellspacing="10"  style="display:none" id="ID_Table_dev">
	</table>
	<table width="100%" cellspacing="10"  style="display:none" id="ID_Table_dev_detail">
	</table>
	<script>getClientMac();</script>
</fieldset>
<%+footer%>